XML format for describing datasets
==================================

For each dataset we will need two XML files:

Dataset XMD File
----------------

In addition to an XML file containing the metadata (in one of several possible formats),
we will need an XML file that describes identification etc. for the dataset. 

Such XML files will be given an ".xmd" extention, and have a format like this:

<dataset xmlns="" ...>                       // Ref. to XML namespace etc.
   <info status="..."                        // Value: active/deleted 
         ownertag="..."
         creationDate="..."                  // YYYY-MM-DDTHH:TT:SSZ
         datestamp="..."                     // YYYY-MM-DDTHH:TT:SSZ
         metadataFormat="..."                // Example: DIF, MM2
         name="..." />                       // Unique identification
   <quadtree>
      ...
   </quadtree> 
</dataset>

Example XMD file:

<?xml version="1.0" encoding="iso8859-1" ?>
<?xml-stylesheet href="dataset.xsl" type="text/xsl"?>
<dataset
   xmlns="http://www.met.no/schema/metamod/dataset"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.met.no/schema/metamod/dataset https://wiki.met.no/_media/metamod/dataset.xsd">
  <info name="DAMOC/test" 
        status="active" 
        ownertag="DAM"
        creationDate="2008-10-31T14:30:00Z"
        datestamp="2008-10-31T14:30:00Z"
        metadataFormat="MM2" />
  <quadtree_nodes>
  1
  11
  113
  </quadtree_nodes>
</dataset>


Metadata XML File
-----------------

The XML files containing metadata are of varying formats. They will all be given an
".xml" extention.

One of these formats are defined by METAMOD2, and is only used as an internal format
within the METAMOD2 system. This format (MM2) is for metadata produced by the UPLOAD
module or the QUEST module:

<code>
   <MM2 xmlns="" ...>                              // Ref. to XML namespace etc. (if needed)
         <metadata name="...">value</metadata>     // To be repeated. One element
                                                   // for each name,value pair.
   </MM2>
</code>

Metadata names with special meaning
-----------------------------------

METAMOD is generally ignorant of metadata-names, and most names can be configured. But some
names have a special meaning and cannot be changed:

   area                        Geographic area either as detailed area 'Fram Strait' or as
                               gcmd-list 'Continent > Europe > Northern Europe > Scandanavia > Norway'.

   bounding_box                For the extraction of quadtree-nodes for geographic search (if no
                               detailed coordinate set is available).
   datacollection_period_from
   datacollection_period_to
   datacollection_period       Deprecated since metamod 2.1

   topic                       Used in quest as gcmd-list without '> HIDDEN', see 'variable'.

   variable                    Parameter, either as CF-1.0 standard_name e.g. 'sea_surface_temperature'
                               or as gcmd-list with '> HIDDEN':
                               'Agriculture > Agricultural Chemicals > Fertilizers > HIDDEN'

   activity_type               Used for "Activity types" search

   institution                 Used for "Institutions" search

   dataref                     If the value of a 'dataref' element is recognised as an
                               URL (starting with 'http://'), the value is presented in
                               the METAMODSEARCH web interface in a special way. The last
                               part of the value (corresponding to the regexp:
                               '([^/]*)\/?$') is presented as a text linked to the given
                               URL. If the URL ends with '.nc', it is assumed to be an
                               OPeNDAP link. In that case, an '.html' is appended to the
                               URL, so it will point to the HTML form-based view of the
                               netCDF file.
                               Othervise (no URL), the value is presented in a normal
                               way.
